package com.hwd.srb.adapter;

import com.hwd.srb.core.util.Amount3Helper;
import org.springframework.lang.Nullable;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @author 黄伟东/Victor
 * @date 2022/3/31 22:41
 * @Description
 */
public class Amount3HelperAdapter implements AmountHelperAdapter {
    @Override
    public boolean supports(Object amountHelper) {
        return (amountHelper instanceof Amount3Helper);
    }

    @Override
    @Nullable
    public BigDecimal getInterestCount(BigDecimal invest, BigDecimal yearRate, int totalMonth) {
        return Amount3Helper.getInterestCount(invest, yearRate, totalMonth);
    }

    @Override
    @Nullable
    public Map<Integer, BigDecimal> getPerMonthPrincipal(BigDecimal invest, BigDecimal yearRate, int totalMonth) {
        return Amount3Helper.getPerMonthPrincipal(invest, yearRate, totalMonth);
    }

    @Override
    @Nullable
    public Map<Integer, BigDecimal> getPerMonthInterest(BigDecimal invest, BigDecimal yearRate, int totalMonth) {
        return Amount3Helper.getPerMonthInterest(invest, yearRate, totalMonth);
    }
}
